package game.view.screen 
{
	import starling.core.Starling;
	import starling.display.Sprite;
	
	/**
	 * ...
	 * @author Thot
	 */
	
	public class ApplicationScreen extends Sprite
	{
		
		private static var _instance:ApplicationScreen;
		
		private var _starling:Starling;
		private var _menu:MenuScreen;
		private var _gameBoard:GameBoardScreen;
		
		
		
		
		public function ApplicationScreen() 
		{
			if ( _instance != null )
			{
				throw( new Error("singleton") );
			}
			
			_instance = this;
			init();
		}
		
		public function init():void
		{
			_starling = Starling.current;
			_menu = new MenuScreen();
			_gameBoard = new GameBoardScreen();
			
			addChild(_gameBoard);
			addChild(_menu);
		}
		
		public function get menu():MenuScreen
		{
			return _menu;
		}
		
		public function get gameBoard():GameBoardScreen
		{
			return _gameBoard;
		}
	
		
		
		
		//singleton
		public static function getInstance():ApplicationScreen
		{
			return _instance || new ApplicationScreen();
		}
		
		
	}

}